import cv2 as cv
import numpy as np

img = cv.imread("/home/jake/Pictures/test.jpeg")

rows,cols,ch = img.shape

print rows,cols

pts1 = np.float32([[0, 0],[0, 100],[100, 0]])
pts2 = np.float32([[0, 0],[50, 100],[100, 50]])

M = cv.getAffineTransform(pts1,pts2)

dst = cv.warpAffine(img,M,(cols,rows))

cv.imshow('image',dst)
cv.waitKey(0)